<?php

namespace Database\Seeders;

use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
use App\Models\User;    //引用user模型
use Illuminate\Support\Facades\Hash;    //引入Hash门面

class UsersSeeder extends Seeder
{
    /**
     * Run the database seeds.
     */
    public function run(): void
    {
        User::create([
            'name' => '张三',
            'email' => 'zhangsan@example.com',
            'password' => Hash::make('password123'), // 使用Hash门面加密密码
        ]);

        User::create([
            'name' => '李四',
            'email' => 'lisi@example.com',
            'password' => Hash::make('password456'),
        ]);

        User::create([
            'name' => '王五',
            'email' => 'wangwu@example.com',
            'password' => Hash::make('password789'),
        ]);
    }
}
